/**
 * Copyright 2020 Inc.
 **/
package com.myz.alibaba.sentinel;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author maoyz0621 on 20-4-2
 * @version v1.0
 */
@SpringBootApplication
@EnableDiscoveryClient
public class SentinelApplication {

    public static void main(String[] args) {
        SpringApplication.run(SentinelApplication.class, args);
    }

    @GetMapping(value = "/hello1")
    @SentinelResource("hello1")
    public String hello1() {
        return "Hello Sentinel 1";
    }

    @GetMapping(value = "/hello2")
    @SentinelResource("hello2")
    public String hello2() {
        return "Hello Sentinel 2";
    }
}
